﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.fmtx.IDal;
using com.fmtx.Model;
using fmtx.Framework.NotSqlHelper;
using fmtx.Framework.Model;

namespace com.fmtx.Dal
{
    public class BaseServer<T>:IBase<T> where T: BaseBean
    {
        protected MongoOperation<T> db = new MongoOperation<T>();

        public bool Add(T bean)
        {
            return db.Add(bean);
        }

        public bool Update(T bean)
        {
            return db.Update(bean);
        }

        public bool Delete(int id)
        {
            return db.Delete(id);
        }

        public T Get(int id)
        {
            return db.Load(id);
        }

        public IEnumerable<T> GetAll()
        {
            return db.AllList();
        }
    }
}
